module top_module ( 
    input p1a, p1b, p1c, p1d, p1e, p1f,
    output p1y,
    input p2a, p2b, p2c, p2d,
    output p2y );

	wire left_up, left_down,right_up, right_down;
    assign left_up = p2a&p2b;
    assign left_down = p2c&p2d;
    assign right_up = p1a&p1b&p1c;
    assign right_down = p1f&p1d&p1e;
    assign p2y = left_up|left_down;
    assign p1y = right_up|right_down;
	
endmodule